package com.ken.user.mapper;

import com.ken.common.pojo.*;

import com.ken.common.pojo.Class;
import com.ken.user.dto.*;
import com.ken.user.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface
userMapper {
    student selectStudentByPhone(String phone);
    teacher selectTeacherByPhone(String phone);
    void teacherRegister(teacher teacher);
    void studentRegister(student student);
    student selectStudentById(String id);
    teacher selectTeacherById(String id);
    student selectStudentBySchoolId(@Param("id") String id,@Param("school") String school);
    teacher selectTeachBySchoolId(@Param("id") String id,@Param("school") String school);
    Class selectClassById(String class_id);
    void addStudent(@Param("class_id") String class_id,@Param("id") String student_id);
    void addTeacher(@Param("class_id") String class_id,@Param("id") String teacher_id);
    void increaseNum(joinClassDto dto);
    List<student> getClassStudent(String class_id);
    List<questionVo> getQuestionByHomework(String homework_id);
    List<homeworkVo> getHomeworkByClass(String class_id);
    List<examVo> getExamByClass(String class_id);
    paperVo getPaperById(String paper_id);
    List<questionVo> getQuestionByPaper(String paper_id);
    List<String> getQuestionIdByHomework(String homework_id);
    answerVo getAnswer(@Param("homework_id") String homework_id,@Param("student_id") String student_id,@Param("question_id") String question_id);
    homework_stateVo get_homeworkState(@Param("student_id") String student_id,@Param("homework_id") String homework_id);
    Question get_questionById(String question_id);
    void save_wrongQuestion(wrongQuestionDto dto);
    List<unitVo> getUnitByClass(String class_id);
    List<lessonVo> getLessonByUnit(String lesson_id);
    void upload_studyRecord(studyRecordDto dto);
    Class getClassByClassId(String class_id);
    List<Class> getClassByCourseId(String course_id);
    String checkClassStudent(@Param("class_id") String class_id,@Param("student_id") String student_id);
    String checkClassTeacher(@Param("class_id") String class_id,@Param("teacher_id") String teacher_id);
    homeworkVo getHomeworkState(check_homeworkDto dto);
    void changeClassHomeworkState(check_homeworkDto dto);
    homework getHomeworkById(String homework_id);
    List<homework> getHomeworkByCourseId(String course_id);
    List<message> getMessageByClassId(String class_id);
    List<attendance> getAttendanceRecordState(String code);
    void change_messageState(@Param("student_id") String student_id,@Param("message_id") String message_id);
    void create_knowledgePoints(knowledgePoint knowledgePoint);
    List<knowledgePoint> select_knowledgePoints(@Param("root") String root);
    knowledgePoint select_knowledgePoint(@Param("id") String id);
    void delete_knowledgePoints(@Param("root") String root);
    void save_question(Question question);
    lessons getLessonById(@Param("lesson_id") String lesson_id);
    List<lessons> getLessonsByUnit(@Param("unit_id") String unit_id);
    knowledgePoint getKnowledgePointById(@Param("knowledgePointId") String knowledgePointId);
    List<studyRecord> getRecordById(@Param("student_id") String student_id);
    void update_knowledgePoint(knowledgePoint knowledgePoint);
    void delete_lessonKnowledge(@Param("lesson_id") String lesson_id);
    Long getLessonTotalTime(@Param("student_id") String student_id,@Param("lesson_id") String lesson_id);
    message check_message(@Param("message_id") String message_id);
    void update_student(update_userDto dto);
    void update_teacher(update_userDto dto);
    void  update_studentImg(update_imgDto dto);
    void  update_teacherImg(update_imgDto dto);
    List<course> getAllCourse();
}
